Skip to content

chore: clean up ruff lint debt across repo#197

Merged
xdotli merged 1 commit intodev-0.3from
chore/lint-cleanup
Apr 25, 2026
Merged

chore: clean up ruff lint debt across repo#197
xdotli merged 1 commit intodev-0.3from
chore/lint-cleanup

Conversation

@xdotli
Copy link
Copy Markdown
Member

@xdotli xdotli commented Apr 25, 2026

Why

Brings 126 ruff errors → 0 so CI's lint check passes. Unblocks the 5 PRs targeting dev-0.3 (#176, #180, #181, #182, #191) that are currently flagged `unstable` because they inherit pre-existing repo-wide lint debt — none of them introduced new lint failures.

What

Auto-fixes (`ruff check --fix --unsafe-fixes`, ~94 of 126):

  • 40 F401 unused-imports
  • 8 I001 unsorted-imports
  • 6 UP037 quoted-annotations modernized
  • Other auto-fixable rules across src/, tests/, examples/, experiments/, labs/

Hand fixes (~11 of 126):

  • `src/benchflow/init.py`: removed shadowed `Trial` from the harbor re-export block (canonical public `Trial` already imported from `benchflow.trial` two blocks down). Added `trial_config_from_yaml` to `all`.
  • `src/benchflow/process.py`: 3 `raise ConnectionError(...) from e` fixes for B904.
  • `src/benchflow/mcp/reviewer_server.py`: same B904 fix for fastmcp ImportError reraise.
  • `tests/test_skill_eval.py`: raw string for `pytest.raises(match=...)` pattern (RUF043).
  • 3 files: replaced `×` (Unicode multiplication sign) in comments / f-strings with `x` to clear RUF001/RUF003.

Per-file ignores in `pyproject.toml`:

  • `experiments/.py`, `tests/conformance/.py` ignore E402 — standalone scripts that intentionally set `sys.path` before imports.
  • `src/benchflow/runtime.py` ignores F821 — uses forward references resolved by `from future import annotations`; explicit TYPE_CHECKING imports would force eager loads.

Validation

  • `ruff check .`: All checks passed
  • 580 tests pass; 8 pre-existing failures (env-leak between subscription auth tests, Docker compose env, judge_model default mismatch) are unrelated to this PR

Impact on open PRs

After this lands, all 5 `unstable` PRs should flip to `clean`:

Test plan

  • `ruff check .` passes locally
  • Test suite still passes (no behavior changes)
  • CI runs against this branch
  • Devin reviews the resolution choices

Open in Devin Review

Brings 126 ruff errors → 0 so CI's lint check goes green and unblocks
the 5 PRs targeting dev-0.3 (#176, #180, #181, #182, #191) that were
landing on top of pre-existing repo lint debt.

What changed:
1. Auto-fixes via `ruff check --fix --unsafe-fixes`:
   - 40 F401 unused-imports across src/, tests/, examples/
   - 8 I001 unsorted-imports
   - 6 UP037 quoted-annotations modernized
   - Other auto-fixable rules

2. Hand fixes:
   - src/benchflow/__init__.py: removed `Trial` from the `from harbor`
     re-export block (it was shadowed by `from benchflow.trial import Trial`
     at line 65, which is the canonical public Trial). Added
     `trial_config_from_yaml` to __all__.
   - src/benchflow/process.py: 3x `raise ConnectionError(...) from e` for
     B904 (errors raised inside except clauses).
   - src/benchflow/mcp/reviewer_server.py: same B904 fix for fastmcp
     ImportError reraise.
   - tests/test_skill_eval.py: raw string for `pytest.raises(match=...)`
     pattern (RUF043).
   - 3 files: replaced `×` (Unicode multiplication sign) in comments and
     f-strings with `x` (latin x) to clear RUF001/RUF003.

3. Per-file ignores added to pyproject.toml `[tool.ruff.lint.per-file-ignores]`:
   - `experiments/*.py` and `tests/conformance/*.py` ignore E402 — these
     are standalone scripts that legitimately set sys.path before importing.
   - `src/benchflow/runtime.py` ignores F821 — uses forward references
     resolved by `from __future__ import annotations`; explicit
     TYPE_CHECKING imports would force eager loads.

No code behavior changes. 580 tests pass; the 8 pre-existing failures
(env-leak between subscription auth tests, Docker compose env, judge
model default mismatch) are unrelated to this PR.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@xdotli xdotli merged commit a582c0b into dev-0.3 Apr 25, 2026
2 checks passed
@xdotli xdotli deleted the chore/lint-cleanup branch April 25, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant